namespace UnitTesting.Fixturing
{
	class Anonymous<T>
	{
		internal TestObjectCreator<T> TestObjectCreator { get; set; }

		internal Anonymous(IValueProvider valueProvider, IFreezable freezable)
		{
			Ensure.IsNotNull(() => valueProvider);
			TestObjectCreator = new TestObjectCreator<T>(valueProvider, freezable);
		}

		protected Anonymous()
		{
		}

		internal virtual T Create()
		{
			return TestObjectCreator.Create();
		}

		internal T[] CreateMany()
		{
			return TestObjectCreator.CreateMany();
		}

		internal virtual T[] CreateMany(int count)
		{
			return TestObjectCreator.CreateMany(count);
		}

		internal virtual T Freeze()
		{
			return TestObjectCreator.Freeze();
		}
	}
}